Field of the Invention
The present invention relates to the field software testing and more particularly to code instrumentation for software testing and analysis.
Description of the Related Art
The art of software development extends far beyond a mere coding of a functional specification for a computer program. Modern software development conforms to a lifecycle which begins with the functional specification leading into the formulation of a suitable architecture for an application implementing the functional specification. The lifecycle continues with the physical coding of the application and includes iterative testing and modification cycles to ensure the integrity of the code. Finally, the execution of the completed code can be analyzed to facilitate the further revision of the code to improve the performance of the code.
Traditional testing of a computer program can include the external monitoring of the integrity of the program and the performance of the program, either subjectively based upon end user impression, or objectively based upon independently acquired metrics. In the latter circumstance, the integrity of the program can include the simulation of user interaction with the user interface of the program to ensure the proper operation of the program logic. Likewise, the performance of the program can include an internal monitoring of the code through software test tooling as is known in the art.
Code instrumentation is a common form of software test tooling. In code instrumentation, compiled code objects can be decomposed and annotated with additional program code to facilitate in the analysis of code execution and performance. In order to effectively instrument code, the compiled object first must be pre-processed to document all possible code paths and to separate the program code from the data acted upon by the program code. Methods used to pre-process the compiled object include using debugging information and import/export tables, implementing branch following, scanning relocation tables and performing a liveness analysis as will be understood by the skilled artisan.
While conventional compiled object pre-processing methods have proven adequate for some, circumstances arise where conventional compiled object processing falls short of being effective. In this regard, exported data within a binary model often can be mistaken for program code—particularly where the exported data is embedded in the source code as an exported variable. When exported data is embedded in source code, the exported data will be instrumented as program code. Consequently, data corruption can arise as can run-time crashing.